<template>
  <div class="question">
    <div v-if="questionList.length > 0">
      <div v-for="item in questionList" :key="item.id">
        <ForumCard :item="item"></ForumCard>
      </div>
    </div>
    <div v-else>
      <n-result
        status="404"
        title="暂无学术求助"
        description="你可以点击上方发布按钮发布相关求助"
      >
        <template #footer>
          <n-button @click="router.push('/forum/list/0')">逛逛其他</n-button>
        </template>
      </n-result>
    </div>
  </div>
</template>

<script setup>
import ForumCard from '../../Forum/components/ForumCard.vue'
import api from '@/api/api'
const { Help } = api

const router = useRouter()

const props = defineProps({
  id: {
    type: String
  }
})
const { id } = props

onMounted(() => {
  getList()
})

const getList = () => {
  Help.getMention({
    id
  }).then((res) => {
    questionList.value = res.data.questionList
  })
}

const listLoading = ref(true)
//学术求助列表
const questionList = ref([])
</script>

<style scoped lang="scss"></style>
